raar.shape
Class RAShapeMath
java.lang.Object
raar.shape.RAShapeMath
public class RAShapeMath
- extends java.lang.Object
Mathematical tools for shapes. For distance measurements, this version
uses a sonar-like approach, which is reasonably fast and accurate. A
future version could include an analytical distance function for the
most common shapes.
MADE IN SWITZERLAND
|
Field Summary |
static double |
STEP_SIZE
Determine the increase in scan size that the sonar method uses;
accurary is half this setting (i.e. with a setting of 4 and a
distance reported of 100, the actual distance is in the interval
[98,104].... |
|
Method Summary |
static double |
distance(java.awt.Shape s,
java.awt.geom.Point2D.Double p,
java.awt.Shape inRegion)
Returns the (approximate) distance between a shape and a point. |
static boolean |
intersecting(java.awt.Shape a,
java.awt.Shape b)
http://forum.java.sun.com/thread.jsp? |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
STEP_SIZE
public static double STEP_SIZE
- Determine the increase in scan size that the sonar method uses;
accurary is half this setting (i.e. with a setting of 4 and a
distance reported of 100, the actual distance is in the interval
[98,104]....
RAShapeMath
public RAShapeMath()
distance
public static double distance(java.awt.Shape s,
java.awt.geom.Point2D.Double p,
java.awt.Shape inRegion)
- Returns the (approximate) distance between a shape and a point.
Looks only within the shape provided. Returns
a negative value when nothing is found within this distance.
intersecting
public static final boolean intersecting(java.awt.Shape a,
java.awt.Shape b)
- http://forum.java.sun.com/thread.jsp?forum=406&thread=313392